<?php
	session_start();
	
	//Check for correct user privileges
	if(isset($_SESSION['privileges'])){
		if($_SESSION['privileges']=='1'){			//Allow access to the admin backend
			$html = '<html>';
				$html .='<head>';
					
					//Set charset = utf-8
					$html .= '<meta http-equiv="content-type" content="text/html;charset=utf-8" />';
					
					//Google Maps API key
					$html .= '<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ"></script>';
					
					//ExtJS implementation
					$html .= '<link rel="stylesheet" type="text/css" href="../js/lib/ExtJS-3.3.1/resources/css/ext-all.css" />';

					$html .= '<script type="text/javascript" src="../js/lib/ExtJS-3.3.1/adapter/ext/ext-base.js"></script>';
					$html .= '<script type="text/javascript" src="../js/lib/ExtJS-3.3.1/ext-all.js"></script>';
					$html .= '<script type="text/javascript" src="../js/lib/ExtJS-3.3.1/examples/ux/fileuploadfield/FileUploadField.js"></script>';
					$html .= '<script type="text/javascript" src="../js/lib/Ext.ux.form.CheckboxCombo/Ext.ux.form.CheckboxCombo.min.js"></script>';
					$html .= '<link rel="stylesheet" href="../js/lib/Ext.ux.form.CheckboxCombo/Ext.ux.form.CheckboxCombo.min.css" />';
					
					$html .= '<link rel="stylesheet" type="text/css" href="../js/lib/ExtJS-3.3.1/examples/ux/fileuploadfield/css/fileuploadfield.css"/>';
																
					//OpenLayers implementation
					$html .= '<script type="text/javascript" src="../js/lib/OpenLayers-2.13.1/OpenLayers.js"></script>';
						
					//GeoExt implementation
					$html .= '<script type="text/javascript" src="../js/lib/GeoExt-1.1/script/GeoExt.js"></script>';
						
					//App specific implementations
					$html .= '<script type="text/javascript" src="../js/adminAppConfig.js"></script>';	
						
					//App specific styles
					$html .= '<link rel="stylesheet" type="text/css" href="../css/style.css" />';			
				$html .= '</head>';
				$html .= '<body>';
				$html .= '</body>';
			$html .= '</html>';
			
			echo $html;
		}
	}
	else{
		header('Location: ../');
	}	
?>